<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="spring" uri="http://www.springframework.org/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
<head>
    <title><fmt:message key="fileAsset" /></title>
</head>
<body>
    <h1><fmt:message key="fileAsset" /></h1>
    <c:url var="updateUrl" value="/domain/fileAsset/update"/>
    <form:form action="${updateUrl}" id="fileAssetForm" modelAttribute="fileAssetForm" enctype="multipart/form-data">
        <form:errors cssClass="error"/>
        <table>
            <form:hidden path="fileAsset.inode"/>
            <tbody>
				<tr>
					<th>&nbsp;</th>
					<td>
						<img src="${adminHttpUrl}${fileAsset.path}" width="160" height="160" />
					</td>
				</tr>

                <tr>
                    <th><fmt:message key="fileAsset_inode" /></th>
                    <td><c:out value="${fileAssetForm.fileAsset.inode}" /></td>
                </tr>

                <tr>
                    <th><fmt:message key="fileAsset_newFile" /></th>
                    <td>
						<input type="file" name="file" />
                        <form:errors cssClass="error" path="file"/>
                    </td>
                </tr>

                <tr>
                    <th><fmt:message key="fileAsset_title" /></th>
                    <td>
                        <form:input path="fileAsset.title"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "fileAsset.title",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="fileAsset.title"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="fileAsset_friendlyName" /></th>
                    <td>
                        <form:input path="fileAsset.friendlyName"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "fileAsset.friendlyName",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="fileAsset.friendlyName"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="fileAsset_fileName" /></th>
                    <td>
                        <form:input path="fileAsset.fileName" readonly="true" />
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "fileAsset.fileName",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="fileAsset.fileName"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="fileAsset_fileSize" /></th>
                    <td>
                        <form:input path="fileAsset.fileSize" readonly="true" />
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "fileAsset.fileSize",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="fileAsset.fileSize"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="fileAsset_author" /></th>
                    <td>
                        <form:input path="fileAsset.author"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "fileAsset.author",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="fileAsset.author"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="fileAsset_showOnMenu" /></th>
                    <td>
                        <form:checkbox id="fileAsset.showOnMenu" path="fileAsset.showOnMenu"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "fileAsset.showOnMenu",
                                widgetType : "dijit.form.CheckBox",
                                widgetAttrs : {
                                    checked: ${fileAssetForm.fileAsset.showOnMenu != null ? fileAssetForm.fileAsset.showOnMenu : false}
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="fileAsset.showOnMenu"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="fileAsset_sortOrder" /></th>
                    <td>
                        <form:input path="fileAsset.sortOrder"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "fileAsset.sortOrder",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                    ,regExp : "[-+]?[0-9]+(\.[0-9]+)?"
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="fileAsset.sortOrder"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="fileAsset_publishDate" /></th>
                    <td>
                        <c:out value="${fileAssetForm.fileAsset.publishDate}" />
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="fileAsset_modDate" /></th>
                    <td>
						<c:out value="${fileAssetForm.fileAsset.modDate}" />
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="fileAsset_modUser" /></th>
                    <td>
						<c:out value="${fileAssetForm.fileAsset.modUser}" />
                    </td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="2">
                        <div class="buttons">
                            <button id="updateButton" type="submit"><fmt:message key="label.form.submit"/></button>
                            <script type="text/javascript">
                                Spring.addDecoration(new Spring.ValidateAllDecoration({
                                    elementId:'updateButton',
                                    event:'onclick'
                                }));
                            </script>
                            <c:url var="showUrl" value="/domain/fileAsset/show.action">
                                <c:param name="fileAsset.inode" value="${fileAssetForm.fileAsset.inode}"/>
                            </c:url>
                            <a href="${showUrl}"><span><fmt:message key="label.link.show"/></span></a>
                        </div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </form:form>
</body>
